Skip to content

feat: cascade account deletion to the challenges of consents bound to the account - #2961

Closed
hongwei1 wants to merge 3 commits into
OpenBankProject:developfrom
hongwei1:feature/cascade-delete-consent-challenges
Closed

hongwei1 wants to merge 3 commits into
OpenBankProject:developfrom
hongwei1:feature/cascade-delete-consent-challenges

Conversation

@hongwei1

@hongwei1 hongwei1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

DELETE /obp/v4.0.0/management/cascading/banks/{BANK_ID}/accounts/{ACCOUNT_ID} now also removes the SCA challenges of every consent bound to the account, such as the challenge of a Berlin Group consent whose PSU has started but not yet answered its authorisation. A consent names its accounts in the views of its JWT, so the cascade reads the consents that still have challenges, keeps those whose views name this bank and account, and deletes their challenges; the consents themselves are kept. The consents are found through their challenges rather than through users, so a consent with no PSU bound yet is covered. A consent bound to other accounts as well loses its challenges too, since they record the authorisation of the consent as a whole. DELETE /obp/v4.0.0/management/cascading/banks/{BANK_ID} deletes each account through the same code.

DeleteAccountCascadeConsentChallengeTest lodges a Berlin Group consent for each of two accounts the PSU holds, starts each authorisation without answering it, deletes the first account and checks that only that consent's challenge is gone. It holds alongside #2959, which deletes a UK consent's challenge once it is answered.

…s bound to it

DELETE /obp/v4.0.0/management/cascading/banks/{BANK_ID}/accounts/{ACCOUNT_ID}
now also removes the SCA challenges of every consent whose JWT views name the
account. The consents are read from the users who hold or can see the account,
before their account access rows are deleted. The bank cascade deletes each
account through the same code.
…llenge table

The account cascade looked for consents through the users who hold or
can see the account, which misses a Berlin Group consent whose first
challenge is still unanswered: no PSU is bound to it yet. The consents
are now read from the challenges that carry a consent id and kept when
their JWT names the account.

The test now uses such a Berlin Group consent instead of an authorised
UK consent, whose challenge is deleted once answered.
@sonarqubecloud

sonarqubecloud Bot commented Nov 3, 2026

Copy link
Copy Markdown

@hongwei1

hongwei1 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Combined with #2959, #2960 and #2961 into #2962, which carries the same commits as one change.

@hongwei1 hongwei1 closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant